/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pollobeta;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 *
 * @author bender
 */
public class datosMal  extends JFrame implements ActionListener {

            JPanel mensaje,boton;
        JButton cerrar;
        JLabel msj;

        datosMal(){
        super("Pollo Draw");
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setResizable(false);

        setLayout(new BorderLayout());

        mensaje = new JPanel();
        mensaje.setLayout(new BorderLayout());
        mensaje.setPreferredSize(new Dimension(350,150));

        boton = new JPanel();
        boton.setLayout(new BorderLayout());
        boton.setPreferredSize(new Dimension(50,30));


        cerrar = new JButton("Cerrar");
        cerrar.setBackground(Color.ORANGE);
        cerrar.setMnemonic('C');
        cerrar.setActionCommand("cerrar");
        cerrar.addActionListener(this);
        cerrar.setPreferredSize(new Dimension(30, 20));

        msj = new JLabel("               Nombre y/o contraseña incorrecta");

        add(mensaje,BorderLayout.CENTER);
        //add(boton,BorderLayout.SOUTH);
        mensaje.add(boton,BorderLayout.SOUTH);
        mensaje.add(msj,BorderLayout.CENTER);
        boton.add(cerrar,BorderLayout.CENTER);

        pack();
        setVisible(true);


    }


      


   public void actionPerformed(ActionEvent e) {
        JButton btn = (JButton)e.getSource();
        String comando = btn.getActionCommand();
        if(comando.equals("cerrar")){
            System.exit(0);
        }

}

}
